<template>
    <div style="width: 100vw;height: 100vh;overflow: hidden;display: flex">
        <div style="flex: 1">
            <el-image style="width: 100%;height: 100%" fit="cover"
                      src="https://ts1.cn.mm.bing.net/th/id/R-C.87f5998c3e4289fb8b3f3d67aac9c6ad?rik=fzHJvQ3mu4mbcA&riu=http%3a%2f%2fwww.szgsg.com%2fuploads%2fallimg%2f210109%2f1-21010911140L23.jpg&ehk=5QIf6F7%2fby3BKYD3%2b6J%2b9wnrfCr6wTU277Di2vje%2b80%3d&risl=&pid=ImgRaw&r=0"></el-image>
        </div>
        <div class="welcome-title">
            <div style="font-size: 30px;font-weight: bold">欢迎来到我们的仓库平台</div>
            <div style="margin-top: 10px">现代仓库从运输周转、贮存方式和建筑设施上都重视通道的合理布置，货物的分布方式和堆积的最大高度</div>
            <div style="margin-top: 5px">并配置经济有效的机械化、自动化存取设施，以提高贮存能力和工作效率</div>
        </div>
        <div class="right-card">
            <div style="text-align: right">
                <span @click.stop="toggleDark()">暗黑模式</span>
                <el-switch size="small" v-model="isDark"></el-switch>
            </div>
            <router-view v-slot="{ Component }">
                <transition name="el-fade-in-linear" mode="out-in">
                    <component :is="Component" style="height: 100%"></component>
                </transition>
            </router-view>
        </div>
    </div>
</template>
<script setup>
    import { useDark, useToggle } from '@vueuse/core'

    const isDark = useDark()
    const toggleDark = useToggle(isDark)
</script>

<style scoped>
    .right-card {
        width: 400px;
        z-index: 1;
        background-color: var(--el-bg-color);
    }

    .welcome-title {
        position: absolute;
        bottom: 30px;
        left: 30px;
        color: white;
        text-shadow: 0 0 10px black;
    }
</style>
